package com.htlwk.javapractice;

import java.util.function.Consumer;

/**
 * @ClassName ConsumerDemo01
 * @Description TODO
 * @Author liaowenxiong
 * @Date 2024/12/23 21:07
 * @Version 1.0
 */
public class ConsumerDemo01 {
    public static void main(String[] args) {
        String[] strs = {"Hello", "World", "Java"};
        printArray(strs, (s) -> {
            for (String str : s) {
                System.out.println(str);
            }
        });
    }

    public static void printArray(String[] strs, Consumer<String[]> action) {
        action.accept(strs);
    }
}
